﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Services_DrawPrint : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                ZSql zsql = new ZSql();
                string sql = "select *,Convert(char(10),dispTime,120) as Date,Convert(char(10),MaintDate,120) as Date1,Convert(char(10),kddate,120) as Date2,Convert(char(10),wcdate,120) as Date3 from CS_Mailadd where isWC=1 order by Maintaddid desc";
                zsql.Open(sql);
                DataTable dt = new DataTable();
                string strTable = "";
                dt = zsql.m_table;
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        strTable += "<table width=\"100%\" border=\"1\" align=\"center\"><tr><td height=\"25\" colspan=\"6\"><div align=\"center\"> <strong>南川协和海尔星级服务中心派工单</strong></div></td></tr>";
                        strTable += "<tr><td colspan=\"6\"><table width=\"100%\" border=\"0\"><tr><td>业务编号：" + dt.Rows[0]["MaintCode"].ToString() + "</td><td>接修日期：" + dt.Rows[0]["Date1"].ToString() + "</td><td>预约日期：" + dt.Rows[0]["Date3"].ToString() + "</td></tr></table></td></tr>";
                        strTable += "<tr><td height=\"20\" colspan=\"2\"><div align=\"center\">客户名称</div></td><td height=\"20\" colspan=\"2\">" + dt.Rows[0]["Guestname"].ToString() + "</td><td width=\"10%\" height=\"20\"><div align=\"center\">提成工资</div></td> <td width=\"33%\" height=\"20\">" + dt.Rows[0]["mailtc"].ToString().Substring(0, dt.Rows[0]["mailtc"].ToString().Length - 2) + "</td></tr><tr><td height=\"20\" colspan=\"2\"><div align=\"center\">联系电话</div></td><td height=\"20\" colspan=\"2\">" + dt.Rows[0]["Guesttel"].ToString() + "</td><td height=\"20\"><div align=\"center\">出发时间</div></td><td height=\"20\">" + dt.Rows[0]["Date2"].ToString() + "</td></tr><tr><td height=\"20\" colspan=\"2\"><div align=\"center\">客户地址</div></td><td height=\"20\" colspan=\"2\">" + dt.Rows[0]["Guestaddress"].ToString() + "</td><td height=\"20\"><div align=\"center\">修品品牌</div></td><td height=\"20\">" + dt.Rows[0]["comidband"].ToString() + "</td></tr><tr><td height=\"20\" colspan=\"2\"><div align=\"center\">修品型号</div></td><td height=\"20\" colspan=\"2\">" + dt.Rows[0]["comidSpe"].ToString() + "</td><td height=\"20\"><div align=\"center\">购买商场</div></td><td height=\"20\">南川协和家电</td></tr><tr><td height=\"20\" colspan=\"2\"><div align=\"center\">序列号1</div></td><td height=\"20\" colspan=\"2\">" + dt.Rows[0]["xlh1"].ToString() + "</td><td height=\"20\"><div align=\"center\">购买时间</div></td><td height=\"20\">" + dt.Rows[0]["Date"].ToString() + "</td></tr><tr><td height=\"20\" colspan=\"2\"><div align=\"center\">报称故障</div></td><td height=\"20\" colspan=\"2\">" + dt.Rows[0]["maintdelt"].ToString() + "</td><td height=\"10\"><div align=\"center\">材料费</div></td><td height=\"20\">" + dt.Rows[0]["clfy"].ToString().Substring(0, dt.Rows[0]["clfy"].ToString().Length - 2) + "</td></tr><tr><td width=\"5%\" height=\"130\" rowspan=\"5\" valign=\"top\"><p align=\"center\">更<br>换<br>配<br>件<br>：</p>    </td><td width=\"9%\" rowspan=\"5\"><p align=\"center\">服务内容</p>    </td><td colspan=\"2\" rowspan=\"5\">" + dt.Rows[0]["fwcs"].ToString() + "</td><td height=\"20\"><div align=\"center\">维修费</div></td><td>" + dt.Rows[0]["mailfy"].ToString().Substring(0, dt.Rows[0]["mailfy"].ToString().Length - 2) + "</td></tr><tr><td height=\"20\"><div align=\"center\">超保收费</div></td><td>&nbsp;</td></tr><tr><td height=\"20\"><div align=\"center\">填单金额</div></td><td>&nbsp;</td></tr><tr><td height=\"20\"><div align=\"center\">实际收费</div></td><td>&nbsp;</td></tr><tr><td height=\"20\"><div align=\"center\">收款人</div></td><td>" + dt.Rows[0]["maitmen"].ToString() + "</td></tr>";
                        strTable+="<tr><td colspan=\"2\" rowspan=\"3\"><div align=\"center\"><p>客户</p><p>确认</p></div></td><td width=\"28%\" height=\"20\">1.实测电压:＿V</td><td height=\"20\" colspan=\"3\">2.电压是否正常：是&nbsp;&nbsp; 否 &nbsp;&nbsp;&nbsp;&nbsp;3.是否地线带电：是 &nbsp;&nbsp;否 &nbsp;&nbsp;&nbsp;&nbsp;4.是否缺底线：是 &nbsp;&nbsp;否 </td></tr><tr><td height=\"20\">5.是否缺零线：是 否 </td><td height=\"20\" colspan=\"3\">6.电源线是否老化：是 &nbsp;&nbsp;否 &nbsp;&nbsp;&nbsp;&nbsp;7.电源相位是否正确：是 &nbsp;&nbsp;否 </td></tr><tr><td height=\"20\">维修电话：71430000 71459999 </td><td height=\"20\" colspan=\"3\">用户评价：非常满意＿＿满意＿＿一般＿＿不满意＿＿客户签字：</td></tr></table>";                       
                    }
                }
                zsql.Close();
                lblTable.Text = strTable;
            }
        }
    }
}
